package com.dks.controller;

import java.util.*;

import com.dks.models.QsClass;
import com.dks.models.SignIn;
import com.dks.models.student.StudentClass;
import com.dks.repository.ISignInRepository;
import com.dks.result.Result;
import com.dks.result.ResultInfo;
import com.dks.result.ResultModel;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RequestMapping("sign-in")
@RestController
public class SignInController{

    private ISignInRepository signInRepository;

    @Autowired
    public SignInController(final ISignInRepository signInRepositoryIn){
        this.signInRepository = signInRepositoryIn;
    }

    /**
     * @Author: Ah Nan
     * @Description: 签到
     * @Date: 9:52 2020/4/23
     * @Modificd By:
     * @Param: teacher_id 老师id
     * @Param: classroom_id 教室id
     * @Param: student_id 学生id
     * @return:
     * @throw: 请描述异常信息
     */
    @PostMapping("add")
    public ResultModel<Object> addSignIn(@RequestBody StudentClass studentClass) {

        if (null == studentClass.getId()) {
            return Result.makeResult(ResultInfo.ERR_PARAM_NULL, "Id");
        }
        return signInRepository.addSignIn(studentClass);
    }
}
